#pragma once

#include <QObject>
#include <QLabel>
#include <QPaintEvent>
#include <QPropertyAnimation>
#include <QPainter>
#include <QDebug>

class RootcontactItem : public QLabel
{
	Q_OBJECT

	Q_PROPERTY(int rotation READ rotation WRITE setRotation)

public:
	RootcontactItem(bool hasArrow = false,QWidget *parent = nullptr);
	~RootcontactItem();

public:
	void setText(const QString &title);
	void setExpanded(bool expand);

private:
	int rotation();
	void setRotation(int rotation);

protected:
	virtual void paintEvent(QPaintEvent *event)override;

private:
	QString m_titleText;
	int m_rotation;
	bool m_hasArrow;

	QPropertyAnimation *m_animation;

};
